package tsi.trabalho.truco;

import tsi.trabalho.truco.outros.Mensageiro;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Inicio extends Activity{
	
	EditText nome;
	Button button;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_inicio);
		
		nome = (EditText) findViewById(R.id.editText_inicio);
		
		button = (Button) findViewById(R.id.ButtonIniciar);
	}
	
	@Override
	protected void onResume() {
		super.onResume();	
	}
	
	public void iniciarJogo(View view){
		if(nome.length()>0){
			Intent intent = new Intent(this, CriarOuBuscar.class);
			intent.putExtra("nome", nome.getText().toString());
			startActivity(intent);
			finish();
			
		}else{
			Mensageiro.toast(this, "Nome");
		}
		
	}

}
